package com.example.computer_exam_training_sys.service;

import com.example.computer_exam_training_sys.entity.KnowledgeContent;
import com.example.computer_exam_training_sys.mapper.KnowledgeContentMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class KnowledgeContentService {

    @Autowired
    private KnowledgeContentMapper contentMapper;

    public List<KnowledgeContent> getContentsByPointId(Integer pointId) {
        return contentMapper.getContentsByPointId(pointId);
    }

    public int addContent(KnowledgeContent content) {
        return contentMapper.insertContent(content);
    }

    public int updateContent(KnowledgeContent content) {
        return contentMapper.updateContent(content);
    }

    public int deleteContent(Integer contentId) {
        return contentMapper.deleteContent(contentId);
    }
}